import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Login from '../views/Login/Login.vue'
import Register from '../views/Register/Register.vue'
// import ProductList from '../views/ProductList/ProductList.vue'



// 测试路由
import Index from '../testing/Index.vue'
import PointsCheckin from "../testing/PointsCheckin.vue" //积分签到
import Giftcard from "../testing/Giftcard.vue" //礼品卡
import AddressEdit from "../testing/AddressEdit" //外卖地址编辑
import Product from "../testing/Product" //商品（点单）页，傲
import Ordertest from "../testing/Ordertest" //订单页测试，傲
import OrderDetails from "../testing/OrderDetails.vue" //订单详情页 傲






Vue.use(VueRouter)
const routes = [{ //主页
        path: '/',
        name: 'Home',
        component: Home,
        meta: { //控制底部导航是否显示
            showFooter: true
        }
    },
    { //商品页
        path: '/productList',
        name: 'ProductList',
        // component: ProductList,
        // 彻底懒加载
        component: () =>
            import( /* webpackChunkName: "productList" */ '../views/ProductList/ProductList.vue'),
        meta: {
            showFooter: true,
            keepAlive: true
        }
    }, { //订单页
        path: '/order',
        name: 'Order',
        // 彻底懒加载
        component: () =>
            import( /* webpackChunkName: "order" */ '../views/Order.vue'),
        meta: {
            showFooter: true
        }
    }, { //个人页
        path: '/my',
        name: 'My',
        // 彻底懒加载
        component: () =>
            import( /* webpackChunkName: "my" */ '../views/My.vue'),
        meta: { //控制底部导航是否显示
            showFooter: true
        }
    },
    {
        path: '/register',
        name: 'Register',
        component: Register
    },
    {
        path: '/login',
        name: 'Login',
        component: Login
    },
    {
        path: '/index',
        name: 'Index',
        component: Index
    },

    {
        path: '/store',
        name: 'Store',
        // 彻底懒加载
        component: () =>
            import( /* webpackChunkName: "store" */ '../views/Store.vue'),
    },
    {
        path: '/coupon',
        name: 'Coupon',
        // 彻底懒加载
        component: () =>
            import( /* webpackChunkName: "coupon" */ '../views/Coupon.vue'),
    },
    {
        path: '/settlement',
        name: 'Settlement',
        // 彻底懒加载
        component: () =>
            import( /* webpackChunkName: "settlement" */ '../views/Settlement.vue'),
        meta: {
            keepAlive: true
        }
    },
    {
        path: '/setting',
        name: 'Setting',
        // 彻底懒加载
        component: () =>
            import( /* webpackChunkName: "setting" */ '../views/Setting.vue')
    },
    {
        path: '/personInfo',
        name: 'PersonInfo',
        // 彻底懒加载
        component: () =>
            import( /* webpackChunkName: "personInfo" */ '../views/PersonInfo.vue')
    },

    // {
    //     path: '/productList',
    //     name: 'ProductList',
    //     // 彻底懒加载
    //     component: () =>
    //         import( /* webpackChunkName: "find" */ '../views/ProductList.vue')
    // },

    // {
    //   path: '/about',
    //   name: 'About',
    //   // route level code-splitting
    //   // this generates a separate chunk (about.[hash].js) for this route
    //   // which is lazy-loaded when the route is visited.
    //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
    // },

    // 测试
    {
        path: '/tipsLogin',
        name: 'TipsLogin',
        // 彻底懒加载
        component: () =>
            import( /* webpackChunkName: "tipsLogin" */ '../testing/TipsLogin.vue'),
    },
    {
        path: '/points',
        name: 'PointsCheckin',
        component: PointsCheckin //积分签到
    },
    {
        path: '/giftcard',
        name: 'Giftcard',
        component: Giftcard //礼品卡
    },
    {
        path: '/addressedit',
        name: 'AddressEdit',
        component: AddressEdit //外卖地址编辑
    },
    {
        path: '/product',
        name: 'Product',
        component: Product //点单页，傲  Ordertest
    },
    {
        path: '/ordertest',
        name: 'Ordertest',
        component: Ordertest //订单页，傲  可删除
    },
    {
        path: '/details',
        name: 'OrderDetails',
        component: OrderDetails //订单详情页，傲  
    }
]

const router = new VueRouter({
    base: '/xrzp',
    mode: 'history',
    routes
})

export default router